package com.example.filterdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
public class TestController {

    @ResponseBody
    @RequestMapping("/test")
    public String test() {
        return "test";
    }

    @ResponseBody
    @GetMapping("/hello")
    public String hello() {
        return "Hello from Spring Boot!";
    }

    @ResponseBody
    @GetMapping("/forward")
    public String forwardTest() {
        System.out.println("Forwarding request...");
        return "forwardTest";
    }

    @GetMapping("/original")
    public String forward() {
        System.out.println("Original request...");
        return "forward:/forward";
    }
}
